/**
 * @param {character[][]} board
 * @return {boolean}
 */
var isValidSudoku = function(board) {
    let col = {
        0: {},
        1: {},
        2: {},
        3: {},
        4: {},
        5: {},
        6: {},
        7: {},
        8: {},
    }
    let row = {
        0: {},
        1: {},
        2: {},
        3: {},
        4: {},
        5: {},
        6: {},
        7: {},
        8: {},
    }
    let square = {
        0: {},
        1: {},
        2: {},
        3: {},
        4: {},
        5: {},
        6: {},
        7: {},
        8: {},
    }
    for(let i = 0; i < board.length; i++) {
        for(let j = 0;j < board[0].length; j++) {
            if(!isNaN(Number(board[i][j])) && row[i].hasOwnProperty(board[i][j])) {
                return false
            } else if(!isNaN(Number(board[i][j])) && !row[i].hasOwnProperty(board[i][j])) {
                row[i][board[i][j]] = 1
            }
            if(!isNaN(Number(board[i][j])) && col[j].hasOwnProperty(board[i][j])) {
                return false
            } else if(!isNaN(Number(board[i][j])) && !col[j].hasOwnProperty(board[i][j])) {
                col[j][board[i][j]] = 1
            }
            let n = Math.floor(i / 3) + 3 * Math.floor(j / 3)
            if(!isNaN(Number(board[i][j])) && square[n].hasOwnProperty(board[i][j])) {
                return false
            } else if(!isNaN(Number(board[i][j])) && !square[n].hasOwnProperty(board[i][j])) {
                square[n][board[i][j]] = 1
            }
        }
    }
    return true
};